<template>
	<view class="columnbox wdh-100 content">
		<view class="rowbox def-bgcol top-box wdh-100">
			<view v-if="isLogin" class="rowbox wdh-100 spb" @click="showUserDetail">
				<view class="rowbox als">
					<image class="user-img" :src="user.logo" mode="aspectFill"></image>
					<view class="columnbox als ">
						<view class="user-name">{{user.name}}</view>
						<view class="keshi">{{user.keshi}} {{user.zhicheng}}</view>
						<view class="keshi">{{user.jigou}}</view>
					</view>
				</view>
				<u-icon name="arrow-right" size="32rpx" color="#fff"></u-icon>
			</view>
			<view v-else class="wdh-100 rowbox spb" @click="toLog">
				<view class="rowbox">
					<image class="user-img" src="/static/img/tx.png" mode="aspectFill"></image>
					<view class="columnbox als user-name">
						<view>立即登录</view>
					</view>
				</view>
			</view>
		</view>
		<view class="rowbox m-box spb">
			<view class="rowbox one-m-box" @click="showXinChou">
				<image src="/static/img/wallet.svg" mode="widthFix"></image>
				我的收入
			</view>
			<view class="rowbox one-m-box" @click="showWenzhen">
				<image src="/static/img/record.svg" mode="widthFix"></image>
				问诊记录
			</view>
		</view>
		<view class="one-info rowbox spb wdh-100 mg-box" @click="editInfo">
			<view class="rowbox">
				<image src="../../static/img/ysba.svg" mode="widthFix"></image>
				医生认证备案 <text v-if="user.beian==2"
					style="font-size: 24rpx;margin-left: 20rpx;color: #37d0b6 ;">备案中</text>
				<text v-else-if="user.beian==3" style="font-size: 24rpx;margin-left: 20rpx;color: #37d0b6 ;">已备案</text>
			</view>
			<u-icon name="arrow-right" size="28rpx"></u-icon>
		</view>
		<view class="one-info rowbox spb wdh-100" @click="showSignature">
			<view class="rowbox">
				<image src="../../static/img/dzqm.svg" mode="widthFix"></image>
				我的签名
			</view>
			<u-icon name="arrow-right" size="28rpx"></u-icon>
		</view>
		<!-- <view class="one-info rowbox spb wdh-100" @click="myChufang">
            <view class="rowbox">
                <image src="../../static/img/wdcf.svg" mode="widthFix"></image>
                我的处方
            </view>
            <u-icon name="arrow-right" size="28rpx"></u-icon>
        </view> -->
		<view class="one-info rowbox spb wdh-100" @click="kaifangZhongyao">
			<view class="rowbox">
				<image src="../../static/img/wdcf.svg" mode="widthFix"></image>
				已开中药处方
			</view>
			<u-icon name="arrow-right" size="28rpx"></u-icon>
		</view>
		<view class="one-info rowbox spb wdh-100" @click="kaifangXiyao">
			<view class="rowbox">
				<image src="../../static/img/wdcf.svg" mode="widthFix"></image>
				已开西药处方
			</view>
			<u-icon name="arrow-right" size="28rpx"></u-icon>
		</view>
		<view class="one-info rowbox spb wdh-100" @click="serveSetting">
			<view class="rowbox">
				<image src="../../static/img/fwsz.svg" mode="widthFix"></image>
				服务设置
			</view>
			<u-icon name="arrow-right" size="28rpx"></u-icon>
		</view>
		<view class="one-info rowbox spb wdh-100 mg-box" @click="setWorkTime">
			<view class="rowbox">
				<image src="../../static/img/xywy.svg" mode="widthFix"></image>
				工作时间设置
			</view>
			<u-icon name="arrow-right" size="28rpx"></u-icon>
		</view>
		<view class="one-info rowbox spb wdh-100" @click="callKefu">
			<view class="rowbox">
				<image src="../../static/img/kf.svg" mode="widthFix"></image>
				客服
			</view>
			<u-icon name="arrow-right" size="28rpx"></u-icon>
		</view>
		<view class="one-info rowbox spb wdh-100 mg-box" @click="showSet">
			<view class="rowbox">
				<image src="../../static/img/sz.svg" mode="widthFix"></image>
				设置
			</view>
			<u-icon name="arrow-right" size="28rpx"></u-icon>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {}
		},
		computed: {
			user() {
				return this.$store.state.user
			},
			isLogin() {
				return this.$store.state.isLogin
			}
		},
		onShow() {
		},
		methods: {
			setWorkTime() {
				if (this.isLogin) {
					uni.navigateTo({
						url: '/packageA/workTime/workTime'
					})
				} else {
					this.$noLog()
				}
			},
			showUserDetail() {
				uni.navigateTo({
					url: '/packageA/editUserInfo/resume'
				})
			},
			showSet() {
				if (this.isLogin) {
					uni.navigateTo({
						url: '/packageA/set/set'
					})
				} else {
					this.$noLog()
				}
			},

			// 客服
			callKefu() {
				uni.makePhoneCall({
					phoneNumber: this.user.kefu
				})
			},
			// 认证备案
			editInfo() {
				if (this.isLogin) {
					uni.navigateTo({
						url: '/packageA/editUserInfo/editUserInfo'
					})
				} else {
					this.$noLog()
				}
			},
			// 已开西药
			kaifangXiyao() {
				uni.navigateTo({
					url: '/packageA/myKaifang/xiyao'
				})
			},
			// 已开中药
			kaifangZhongyao() {
				uni.navigateTo({
					url: '/packageA/myKaifang/zhongyao'
				})
			},

			showSignature() {
				if (this.isLogin) {
					uni.navigateTo({
						url: '/pages/signature/index'
					})
				} else {
					this.$noLog()
				}
			},
			showWenzhen() {
				if (this.isLogin) {
					uni.navigateTo({
						url: '/pages/wenzhen/wenzhen'
					})
				} else {
					this.$noLog()
				}
			},
			serveSetting() {
				if (this.isLogin) {
					uni.navigateTo({
						url: '/pages/serveSetting/serveSetting'
					})
				} else {
					this.$noLog()
				}
			},
			showXinChou() {
				if (this.isLogin) {
					uni.navigateTo({
						url: '/pages/wallet/wallet'
					})
				} else {
					this.$noLog()
				}
			},
			myChufang() {
				if (this.isLogin) {
					uni.navigateTo({
						url: '/pages/myChufang/myChufang'
					})
				} else {
					this.$noLog()
				}
			},
			goodsTest() {
				uni.navigateTo({
					url: '/packageA/goods/list'
				})
			},
			toLog() {
				this.$noLog()
			},
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		min-height: 100vh;
		background: #F5F8FB;
		justify-content: flex-start;
	}

	.top-box {
		padding: 20rpx 40rpx;
		padding-bottom: 100rpx;
	}

	.user-img {
		width: 120rpx;
		height: 120rpx;
		border-radius: 100rpx;
		margin-right: 20rpx;
	}

	.user-name {
		color: #fff;
		font-size: 32rpx;
		line-height: 50rpx;
	}

	.keshi {
		color: rgba(#fff, .8);
		font-size: 24rpx;
		line-height: 40rpx;
	}

	.m-box {
		width: 700rpx;
		height: 150rpx;
		background: #fff;
		border-radius: 20rpx;
		margin-top: -50rpx;
		padding: 0 70rpx;
		box-shadow: 0 2px 10rpx 5rpx rgba(#457679, .1);
		margin-bottom: 40rpx;
		font-size: 32rpx;

		.one-m-box {
			image {
				width: 90rpx;
				height: 90rpx;
				margin-right: 20rpx;
			}
		}
	}

	.one-info {
		background: #fff;
		padding: 32rpx 40rpx;
		font-size: 28rpx;
		color: #656767;
		border-bottom: #F5F8FB solid 1px;

		image {
			width: 50rpx;
			height: 50rpx;
			margin-right: 20rpx;
		}
	}

	.mg-box {
		margin-bottom: 20rpx;
	}
</style>